//
//@File    :	4.18_arraynew.cpp
//@Time    :	2021/08/03 18:22:00
//@Auther  :	Sun Sheng
//@Contact :	970340843@qq.com
//@Desc    :	using the new operator for arrays
//

#include <iostream>

int main()
{
    using namespace std;
    double * p3 = new double [3];
    p3[0] = 0.2;
    p3[1] = 0.5;
    p3[2] = 0.8;
    cout<<"p3[1] is "<<p3[1]<<".\n";
    p3 = p3 + 1;
    cout<<"Now p3[0] is "<<p3[0]<<" and ";
    cout<<"p3[1] is "<<p3[1]<<".\n";
    p3 = p3 - 1;
    delete [] p3;
    system("pause");
    return 0;
}